﻿<template>
    <div>
        <h2>你好,这里是名为Hello World的一个普通组件</h2>
        <button @click="back">后退</button>
        <button @click="forward">前进</button>
        <button @click="test">测试一下API-go</button>
    </div>
</template>

<script>
    export default {
        name: 'HelloWorld',
        components:{},
        methods:{
            back(){
                //this.$router中的back就是回退
                this.$router.back()
            },
            forward(){
                 //this.$router中的forward就是前进
                 this.$router.forward()
            },
            test(){
                this.$router.go(-2)
            },
        },
    }
</script>

<style scoped>

</style>